package com.billdowney.entity.system.notice;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Type;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;
import com.billdowney.entity.file.FileInfo;
import com.billdowney.entity.user.UserInfo;

import io.swagger.annotations.ApiModelProperty;

/**
 * 系统通知记录表
 * 
 * @author 超级小富翁 - BillDowney
 * @date 2019年3月26日 下午2:07:23
 */
@Entity
@Table(name = "system_notice")
public class SystemNotice extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = 1L;
	@ApiModelProperty(value = "发送者")
	@Column(length = 50)
	private String sender;
	@ApiModelProperty(value = "主题")
	@Column(length = 100)
	private String subject;
	@ApiModelProperty(value = "内容")
	@Type(type = "text")
	private String content;
	@ApiModelProperty(value = "通知类型")
	@Enumerated(EnumType.STRING)
	@Column(length = 20)
	private SystemNoticeType noticeType;

	@ManyToOne(targetEntity = UserInfo.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "userInfo_id")
	@ApiModelProperty(value = "用户信息")
	private UserInfo userInfo;

	@ApiModelProperty(value = "附件", notes = "需要查询关联表(SystemMailAttachment)手动加入")
	@Transient
	private List<FileInfo> fileInfos;
	@ApiModelProperty(value = "收件人", notes = "需要查询关联表(SystemMailAddressee)手动加入")
	@Transient
	private String[] addressee;

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public SystemNoticeType getNoticeType() {
		return noticeType;
	}

	public void setNoticeType(SystemNoticeType noticeType) {
		this.noticeType = noticeType;
	}

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	public List<FileInfo> getFileInfos() {
		return fileInfos;
	}

	public void setFileInfos(List<FileInfo> fileInfos) {
		this.fileInfos = fileInfos;
	}

	public String[] getAddressee() {
		return addressee;
	}

	public void setAddressee(String[] addressee) {
		this.addressee = addressee;
	}

}
